package com.dz.goods.controller;

import com.dz.common.base.BaseApiService;
import com.dz.common.base.ResponseBase;
import com.dz.goods.domain.entity.Sku;
import com.dz.goods.domain.entity.Spu;
import com.dz.goods.service.SkuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : SkuController
 * @Description :
 * @Author : ming
 * @Date: 2021-03-08 14:26
 **/
@RestController
@RequestMapping("/goods/sku")
@Api(tags = "SKU管理")
public class SkuController extends BaseApiService {
    @Autowired
    private SkuService skuService;

    @GetMapping("/get_by_id")
    @ApiOperation(value = "根据id查询SPU")
    public ResponseBase getSkuById(Long skuId) throws Exception {
        Sku sku = skuService.findById(skuId);
        return setResultSuccess(sku) ;
    }
}
